#include <stdlib.h>
#include <pthread.h>

#include "utils.h"



struct memchunk_queue *memchunk_queue(int min)
{
    struct memechunk_queue *queue = malloc(sizeof(struct memchunk_queue));
    
    pthread_mutex_init(queue->mutex);
    list_init(&queue->head);
    queue->min = 4;
    queue->size = 0;
    return queue; 
}

struct get_memchunk(struct memchunk_queue *queue)
{
}


void memechunk_queue_free(struct memchunk_queue *queue)
{
    list_node node;
    list_for_each(queue->head,node) {
    }
    free(queue);
}

struct memchunk *memchunk_new(int length)
{
    struct memchunk *chunk = malloc(sizeof(struct memchunk));
    chunk->mem = malloc(length);
    chunk->length = length;
    chunk->pos = 0;
    list_init(&chunk->node);
    return chunk;
}

void memchunk_free(struct memchunk *chunk)
{
    free(chunk->mem);
    free(chunk);
}
